<div class="admin list goods">

	<a class="btn add" href="<?php $params = array(); if($categoryId > 0) {$params['categoryId'] = $categoryId;} echo $this->createUrl('/admin/gallery/editor/', $params); ?>">Добавить галерею</a>

    <table>
        <tr>
            <th>Название</th>
            <th></th>
        </tr>

        <?php if($oRowset): ?>
            <?php $index = 0; foreach($oRowset as $oRow): $index++;
		        if(empty($oRow['data']))
			        continue;

	            $aRow = json_decode($oRow['data'], true);

		        if(empty($aRow))
			        continue;
	        ?>
            <tr class="row<?php echo $index % 2 == 1 ? ' grey' : ''; ?>">
                <td>
                    <?php
                    if(!empty($aRow['photos']))
                    {
                        $photo = current($aRow['photos']);
                        $photo = strtr($photo, array('4x' => 'MULTIVIEW_THUMBNAILS'));
                        echo '<img width="55" style="margin: 0 15px 0 0;" alt="" src="'. $photo .'" />';
                    }

                    echo $aRow['title'];
//	                    print_r($aRow);
                    ?>
                </td>
                <td class="action urls">
	                <a class="add" href="<?php echo $this->createUrl('/admin/category/viewNewGoods/', array('id' => $oRow->id)); ?>">Добавить в магазин</a>
	                <a class="not-new" href="<?php echo $this->createUrl('/admin/category/newGoodsIsNotNew/', array('id' => $oRow->id)); ?>">Не показывать в нових</a>
                </td>
            </tr>
            <?php endforeach; ?>

        <?php endif; ?>
    </table>

    <?php
    $this->widget('CLinkPager', array(
        'pages' => $this->oPager,
        'maxButtonCount'=>5,
        'header'=>'',
        'htmlOptions'=>array('class'=>'pager'),
    )); ?>
</div>